<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Config_model extends My_Model {
	var	$_table			= 'configs';

    function __construct()
    {
        parent::__construct();
		$this->load->database();
    }

	function doList(){
		$this->db->order_by("show_order", "ASC"); 
		//$this->db->cache_on();
		$query = $this->db->get($this->_table);
		//$this->db->cache_off();
		$res = array();
		foreach ($query->result_array() as $row)
		{
		  $res[] = $row;
		}
		return $res;
	}

	function save($data){
		@unlink(realpath(APPPATH).'/tmp/~configure.php');
		foreach($data as $key=>$val){
			$row = array('id'=>$key,'value'=>trim($val));
			parent::save($row);
		}
		return true;
	}
}
/* End of file config.php */
/* Location: ./application/models/config.php */